function _(g) {
  return g && g.__esModule && Object.prototype.hasOwnProperty.call(g, "default") ? g.default : g;
}
var T = { exports: {} }, D = T.exports, j;
function U() {
  return j || (j = 1, function(g, l) {
    (function(i, a) {
      a(g);
    })(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : D, function(i) {
      if (!(globalThis.chrome && globalThis.chrome.runtime && globalThis.chrome.runtime.id))
        throw new Error("This script should only be loaded in a browser extension.");
      if (globalThis.browser && globalThis.browser.runtime && globalThis.browser.runtime.id)
        i.exports = globalThis.browser;
      else {
        const a = "The message port closed before a response was received.", d = (h) => {
          const y = {
            alarms: {
              clear: {
                minArgs: 0,
                maxArgs: 1
              },
              clearAll: {
                minArgs: 0,
                maxArgs: 0
              },
              get: {
                minArgs: 0,
                maxArgs: 1
              },
              getAll: {
                minArgs: 0,
                maxArgs: 0
              }
            },
            bookmarks: {
              create: {
                minArgs: 1,
                maxArgs: 1
              },
              get: {
                minArgs: 1,
                maxArgs: 1
              },
              getChildren: {
                minArgs: 1,
                maxArgs: 1
              },
              getRecent: {
                minArgs: 1,
                maxArgs: 1
              },
              getSubTree: {
                minArgs: 1,
                maxArgs: 1
              },
              getTree: {
                minArgs: 0,
                maxArgs: 0
              },
              move: {
                minArgs: 2,
                maxArgs: 2
              },
              remove: {
                minArgs: 1,
                maxArgs: 1
              },
              removeTree: {
                minArgs: 1,
                maxArgs: 1
              },
              search: {
                minArgs: 1,
                maxArgs: 1
              },
              update: {
                minArgs: 2,
                maxArgs: 2
              }
            },
            browserAction: {
              disable: {
                minArgs: 0,
                maxArgs: 1,
                fallbackToNoCallback: !0
              },
              enable: {
                minArgs: 0,
                maxArgs: 1,
                fallbackToNoCallback: !0
              },
              getBadgeBackgroundColor: {
                minArgs: 1,
                maxArgs: 1
              },
              getBadgeText: {
                minArgs: 1,
                maxArgs: 1
              },
              getPopup: {
                minArgs: 1,
                maxArgs: 1
              },
              getTitle: {
                minArgs: 1,
                maxArgs: 1
              },
              openPopup: {
                minArgs: 0,
                maxArgs: 0
              },
              setBadgeBackgroundColor: {
                minArgs: 1,
                maxArgs: 1,
                fallbackToNoCallback: !0
              },
              setBadgeText: {
                minArgs: 1,
                maxArgs: 1,
                fallbackToNoCallback: !0
              },
              setIcon: {
                minArgs: 1,
                maxArgs: 1
              },
              setPopup: {
                minArgs: 1,
                maxArgs: 1,
                fallbackToNoCallback: !0
              },
              setTitle: {
                minArgs: 1,
                maxArgs: 1,
                fallbackToNoCallback: !0
              }
            },
            browsingData: {
              remove: {
                minArgs: 2,
                maxArgs: 2
              },
              removeCache: {
                minArgs: 1,
                maxArgs: 1
              },
              removeCookies: {
                minArgs: 1,
                maxArgs: 1
              },
              removeDownloads: {
                minArgs: 1,
                maxArgs: 1
              },
              removeFormData: {
                minArgs: 1,
                maxArgs: 1
              },
              removeHistory: {
                minArgs: 1,
                maxArgs: 1
              },
              removeLocalStorage: {
                minArgs: 1,
                maxArgs: 1
              },
              removePasswords: {
                minArgs: 1,
                maxArgs: 1
              },
              removePluginData: {
                minArgs: 1,
                maxArgs: 1
              },
              settings: {
                minArgs: 0,
                maxArgs: 0
              }
            },
            commands: {
              getAll: {
                minArgs: 0,
                maxArgs: 0
              }
            },
            contextMenus: {
              remove: {
                minArgs: 1,
                maxArgs: 1
              },
              removeAll: {
                minArgs: 0,
                maxArgs: 0
              },
              update: {
                minArgs: 2,
                maxArgs: 2
              }
            },
            cookies: {
              get: {
                minArgs: 1,
                maxArgs: 1
              },
              getAll: {
                minArgs: 1,
                maxArgs: 1
              },
              getAllCookieStores: {
                minArgs: 0,
                maxArgs: 0
              },
              remove: {
                minArgs: 1,
                maxArgs: 1
              },
              set: {
                minArgs: 1,
                maxArgs: 1
              }
            },
            devtools: {
              inspectedWindow: {
                eval: {
                  minArgs: 1,
                  maxArgs: 2,
                  singleCallbackArg: !1
                }
              },
              panels: {
                create: {
                  minArgs: 3,
                  maxArgs: 3,
                  singleCallbackArg: !0
                },
                elements: {
                  createSidebarPane: {
                    minArgs: 1,
                    maxArgs: 1
                  }
                }
              }
            },
            downloads: {
              cancel: {
                minArgs: 1,
                maxArgs: 1
              },
              download: {
                minArgs: 1,
                maxArgs: 1
              },
              erase: {
                minArgs: 1,
                maxArgs: 1
              },
              getFileIcon: {
                minArgs: 1,
                maxArgs: 2
              },
              open: {
                minArgs: 1,
                maxArgs: 1,
                fallbackToNoCallback: !0
              },
              pause: {
                minArgs: 1,
                maxArgs: 1
              },
              removeFile: {
                minArgs: 1,
                maxArgs: 1
              },
              resume: {
                minArgs: 1,
                maxArgs: 1
              },
              search: {
                minArgs: 1,
                maxArgs: 1
              },
              show: {
                minArgs: 1,
                maxArgs: 1,
                fallbackToNoCallback: !0
              }
            },
            extension: {
              isAllowedFileSchemeAccess: {
                minArgs: 0,
                maxArgs: 0
              },
              isAllowedIncognitoAccess: {
                minArgs: 0,
                maxArgs: 0
              }
            },
            history: {
              addUrl: {
                minArgs: 1,
                maxArgs: 1
              },
              deleteAll: {
                minArgs: 0,
                maxArgs: 0
              },
              deleteRange: {
                minArgs: 1,
                maxArgs: 1
              },
              deleteUrl: {
                minArgs: 1,
                maxArgs: 1
              },
              getVisits: {
                minArgs: 1,
                maxArgs: 1
              },
              search: {
                minArgs: 1,
                maxArgs: 1
              }
            },
            i18n: {
              detectLanguage: {
                minArgs: 1,
                maxArgs: 1
              },
              getAcceptLanguages: {
                minArgs: 0,
                maxArgs: 0
              }
            },
            identity: {
              launchWebAuthFlow: {
                minArgs: 1,
                maxArgs: 1
              }
            },
            idle: {
              queryState: {
                minArgs: 1,
                maxArgs: 1
              }
            },
            management: {
              get: {
                minArgs: 1,
                maxArgs: 1
              },
              getAll: {
                minArgs: 0,
                maxArgs: 0
              },
              getSelf: {
                minArgs: 0,
                maxArgs: 0
              },
              setEnabled: {
                minArgs: 2,
                maxArgs: 2
              },
              uninstallSelf: {
                minArgs: 0,
                maxArgs: 1
              }
            },
            notifications: {
              clear: {
                minArgs: 1,
                maxArgs: 1
              },
              create: {
                minArgs: 1,
                maxArgs: 2
              },
              getAll: {
                minArgs: 0,
                maxArgs: 0
              },
              getPermissionLevel: {
                minArgs: 0,
                maxArgs: 0
              },
              update: {
                minArgs: 2,
                maxArgs: 2
              }
            },
            pageAction: {
              getPopup: {
                minArgs: 1,
                maxArgs: 1
              },
              getTitle: {
                minArgs: 1,
                maxArgs: 1
              },
              hide: {
                minArgs: 1,
                maxArgs: 1,
                fallbackToNoCallback: !0
              },
              setIcon: {
                minArgs: 1,
                maxArgs: 1
              },
              setPopup: {
                minArgs: 1,
                maxArgs: 1,
                fallbackToNoCallback: !0
              },
              setTitle: {
                minArgs: 1,
                maxArgs: 1,
                fallbackToNoCallback: !0
              },
              show: {
                minArgs: 1,
                maxArgs: 1,
                fallbackToNoCallback: !0
              }
            },
            permissions: {
              contains: {
                minArgs: 1,
                maxArgs: 1
              },
              getAll: {
                minArgs: 0,
                maxArgs: 0
              },
              remove: {
                minArgs: 1,
                maxArgs: 1
              },
              request: {
                minArgs: 1,
                maxArgs: 1
              }
            },
            runtime: {
              getBackgroundPage: {
                minArgs: 0,
                maxArgs: 0
              },
              getPlatformInfo: {
                minArgs: 0,
                maxArgs: 0
              },
              openOptionsPage: {
                minArgs: 0,
                maxArgs: 0
              },
              requestUpdateCheck: {
                minArgs: 0,
                maxArgs: 0
              },
              sendMessage: {
                minArgs: 1,
                maxArgs: 3
              },
              sendNativeMessage: {
                minArgs: 2,
                maxArgs: 2
              },
              setUninstallURL: {
                minArgs: 1,
                maxArgs: 1
              }
            },
            sessions: {
              getDevices: {
                minArgs: 0,
                maxArgs: 1
              },
              getRecentlyClosed: {
                minArgs: 0,
                maxArgs: 1
              },
              restore: {
                minArgs: 0,
                maxArgs: 1
              }
            },
            storage: {
              local: {
                clear: {
                  minArgs: 0,
                  maxArgs: 0
                },
                get: {
                  minArgs: 0,
                  maxArgs: 1
                },
                getBytesInUse: {
                  minArgs: 0,
                  maxArgs: 1
                },
                remove: {
                  minArgs: 1,
                  maxArgs: 1
                },
                set: {
                  minArgs: 1,
                  maxArgs: 1
                }
              },
              managed: {
                get: {
                  minArgs: 0,
                  maxArgs: 1
                },
                getBytesInUse: {
                  minArgs: 0,
                  maxArgs: 1
                }
              },
              sync: {
                clear: {
                  minArgs: 0,
                  maxArgs: 0
                },
                get: {
                  minArgs: 0,
                  maxArgs: 1
                },
                getBytesInUse: {
                  minArgs: 0,
                  maxArgs: 1
                },
                remove: {
                  minArgs: 1,
                  maxArgs: 1
                },
                set: {
                  minArgs: 1,
                  maxArgs: 1
                }
              }
            },
            tabs: {
              captureVisibleTab: {
                minArgs: 0,
                maxArgs: 2
              },
              create: {
                minArgs: 1,
                maxArgs: 1
              },
              detectLanguage: {
                minArgs: 0,
                maxArgs: 1
              },
              discard: {
                minArgs: 0,
                maxArgs: 1
              },
              duplicate: {
                minArgs: 1,
                maxArgs: 1
              },
              executeScript: {
                minArgs: 1,
                maxArgs: 2
              },
              get: {
                minArgs: 1,
                maxArgs: 1
              },
              getCurrent: {
                minArgs: 0,
                maxArgs: 0
              },
              getZoom: {
                minArgs: 0,
                maxArgs: 1
              },
              getZoomSettings: {
                minArgs: 0,
                maxArgs: 1
              },
              goBack: {
                minArgs: 0,
                maxArgs: 1
              },
              goForward: {
                minArgs: 0,
                maxArgs: 1
              },
              highlight: {
                minArgs: 1,
                maxArgs: 1
              },
              insertCSS: {
                minArgs: 1,
                maxArgs: 2
              },
              move: {
                minArgs: 2,
                maxArgs: 2
              },
              query: {
                minArgs: 1,
                maxArgs: 1
              },
              reload: {
                minArgs: 0,
                maxArgs: 2
              },
              remove: {
                minArgs: 1,
                maxArgs: 1
              },
              removeCSS: {
                minArgs: 1,
                maxArgs: 2
              },
              sendMessage: {
                minArgs: 2,
                maxArgs: 3
              },
              setZoom: {
                minArgs: 1,
                maxArgs: 2
              },
              setZoomSettings: {
                minArgs: 1,
                maxArgs: 2
              },
              update: {
                minArgs: 1,
                maxArgs: 2
              }
            },
            topSites: {
              get: {
                minArgs: 0,
                maxArgs: 0
              }
            },
            webNavigation: {
              getAllFrames: {
                minArgs: 1,
                maxArgs: 1
              },
              getFrame: {
                minArgs: 1,
                maxArgs: 1
              }
            },
            webRequest: {
              handlerBehaviorChanged: {
                minArgs: 0,
                maxArgs: 0
              }
            },
            windows: {
              create: {
                minArgs: 0,
                maxArgs: 1
              },
              get: {
                minArgs: 1,
                maxArgs: 2
              },
              getAll: {
                minArgs: 0,
                maxArgs: 1
              },
              getCurrent: {
                minArgs: 0,
                maxArgs: 1
              },
              getLastFocused: {
                minArgs: 0,
                maxArgs: 1
              },
              remove: {
                minArgs: 1,
                maxArgs: 1
              },
              update: {
                minArgs: 2,
                maxArgs: 2
              }
            }
          };
          if (Object.keys(y).length === 0)
            throw new Error("api-metadata.json has not been included in browser-polyfill");
          class E extends WeakMap {
            constructor(r, n = void 0) {
              super(n), this.createItem = r;
            }
            get(r) {
              return this.has(r) || this.set(r, this.createItem(r)), super.get(r);
            }
          }
          const F = (e) => e && typeof e == "object" && typeof e.then == "function", P = (e, r) => (...n) => {
            h.runtime.lastError ? e.reject(new Error(h.runtime.lastError.message)) : r.singleCallbackArg || n.length <= 1 && r.singleCallbackArg !== !1 ? e.resolve(n[0]) : e.resolve(n);
          }, p = (e) => e == 1 ? "argument" : "arguments", I = (e, r) => function(n, ...t) {
            if (t.length < r.minArgs)
              throw new Error(`Expected at least ${r.minArgs} ${p(r.minArgs)} for ${e}(), got ${t.length}`);
            if (t.length > r.maxArgs)
              throw new Error(`Expected at most ${r.maxArgs} ${p(r.maxArgs)} for ${e}(), got ${t.length}`);
            return new Promise((o, A) => {
              if (r.fallbackToNoCallback)
                try {
                  n[e](...t, P({
                    resolve: o,
                    reject: A
                  }, r));
                } catch (c) {
                  console.warn(`${e} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `, c), n[e](...t), r.fallbackToNoCallback = !1, r.noCallback = !0, o();
                }
              else r.noCallback ? (n[e](...t), o()) : n[e](...t, P({
                resolve: o,
                reject: A
              }, r));
            });
          }, S = (e, r, n) => new Proxy(r, {
            apply(t, o, A) {
              return n.call(o, e, ...A);
            }
          });
          let b = Function.call.bind(Object.prototype.hasOwnProperty);
          const w = (e, r = {}, n = {}) => {
            let t = /* @__PURE__ */ Object.create(null), o = {
              has(c, s) {
                return s in e || s in t;
              },
              get(c, s, f) {
                if (s in t)
                  return t[s];
                if (!(s in e))
                  return;
                let m = e[s];
                if (typeof m == "function")
                  if (typeof r[s] == "function")
                    m = S(e, e[s], r[s]);
                  else if (b(n, s)) {
                    let u = I(s, n[s]);
                    m = S(e, e[s], u);
                  } else
                    m = m.bind(e);
                else if (typeof m == "object" && m !== null && (b(r, s) || b(n, s)))
                  m = w(m, r[s], n[s]);
                else if (b(n, "*"))
                  m = w(m, r[s], n["*"]);
                else
                  return Object.defineProperty(t, s, {
                    configurable: !0,
                    enumerable: !0,
                    get() {
                      return e[s];
                    },
                    set(u) {
                      e[s] = u;
                    }
                  }), m;
                return t[s] = m, m;
              },
              set(c, s, f, m) {
                return s in t ? t[s] = f : e[s] = f, !0;
              },
              defineProperty(c, s, f) {
                return Reflect.defineProperty(t, s, f);
              },
              deleteProperty(c, s) {
                return Reflect.deleteProperty(t, s);
              }
            }, A = Object.create(e);
            return new Proxy(A, o);
          }, k = (e) => ({
            addListener(r, n, ...t) {
              r.addListener(e.get(n), ...t);
            },
            hasListener(r, n) {
              return r.hasListener(e.get(n));
            },
            removeListener(r, n) {
              r.removeListener(e.get(n));
            }
          }), O = new E((e) => typeof e != "function" ? e : function(r) {
            const n = w(r, {}, {
              getContent: {
                minArgs: 0,
                maxArgs: 0
              }
            });
            e(n);
          }), M = new E((e) => typeof e != "function" ? e : function(r, n, t) {
            let o = !1, A, c = new Promise((u) => {
              A = function(x) {
                o = !0, u(x);
              };
            }), s;
            try {
              s = e(r, n, A);
            } catch (u) {
              s = Promise.reject(u);
            }
            const f = s !== !0 && F(s);
            return s !== !0 && !f && !o ? !1 : (((u) => {
              u.then((x) => {
                t(x);
              }, (x) => {
                let C;
                x && (x instanceof Error || typeof x.message == "string") ? C = x.message : C = "An unexpected error occurred", t({
                  __mozWebExtensionPolyfillReject__: !0,
                  message: C
                });
              }).catch((x) => {
                console.error("Failed to send onMessage rejected reply", x);
              });
            })(f ? s : c), !0);
          }), R = ({
            reject: e,
            resolve: r
          }, n) => {
            h.runtime.lastError ? h.runtime.lastError.message === a ? r() : e(new Error(h.runtime.lastError.message)) : n && n.__mozWebExtensionPolyfillReject__ ? e(new Error(n.message)) : r(n);
          }, N = (e, r, n, ...t) => {
            if (t.length < r.minArgs)
              throw new Error(`Expected at least ${r.minArgs} ${p(r.minArgs)} for ${e}(), got ${t.length}`);
            if (t.length > r.maxArgs)
              throw new Error(`Expected at most ${r.maxArgs} ${p(r.maxArgs)} for ${e}(), got ${t.length}`);
            return new Promise((o, A) => {
              const c = R.bind(null, {
                resolve: o,
                reject: A
              });
              t.push(c), n.sendMessage(...t);
            });
          }, W = {
            devtools: {
              network: {
                onRequestFinished: k(O)
              }
            },
            runtime: {
              onMessage: k(M),
              onMessageExternal: k(M),
              sendMessage: N.bind(null, "sendMessage", {
                minArgs: 1,
                maxArgs: 3
              })
            },
            tabs: {
              sendMessage: N.bind(null, "sendMessage", {
                minArgs: 2,
                maxArgs: 3
              })
            }
          }, v = {
            clear: {
              minArgs: 1,
              maxArgs: 1
            },
            get: {
              minArgs: 1,
              maxArgs: 1
            },
            set: {
              minArgs: 1,
              maxArgs: 1
            }
          };
          return y.privacy = {
            network: {
              "*": v
            },
            services: {
              "*": v
            },
            websites: {
              "*": v
            }
          }, w(h, W, y);
        };
        i.exports = d(chrome);
      }
    });
  }(T)), T.exports;
}
var q = U();
const $ = /* @__PURE__ */ _(q), Z = (g, l, i) => {
  if (!l)
    return null;
  const a = document.querySelectorAll(`*[placeholder='${g}']`);
  for (const d of a)
    return d;
  return null;
}, H = (g) => g.style.display !== "none", z = () => {
  const g = [];
  g.push(document);
  const l = [], i = document.querySelectorAll("iframe");
  for (let a of i)
    if (H(a))
      try {
        let d = a.contentDocument;
        d || (a.contentWindow && (d = a.contentWindow.document), g.push(d));
      } catch {
        a.src.startsWith("http") && l.push(a.contentWindow);
      }
  return g;
}, L = (g) => {
  const l = z();
  for (let i of l) {
    const a = Z(g, i);
    a instanceof HTMLInputElement && (a.classList.add("luhy-highlight"), a.value = "13605305346"), console.log(a);
  }
  iframeEle.contentWindow?.postMessage("输入密码", iframeEle.src);
}, B = window.self === window.top;
console.log(B, "123", JSON.stringify(window.self.Headers));
if (!B) {
  const g = document.createElement("style");
  g.type = "text/css";
  const l = `
      .luhy-highlight {
      outline: dashed green;
    }
    `;
  g.styleSheet ? g.styleSheet.cssText = l : g.appendChild(document.createTextNode(l)), document.head.appendChild(g), window.addEventListener("message", (i) => {
    console.log("获取了消息", i), L(i.data), $.runtime.sendMessage("");
  }, !1);
}
$.runtime.onMessage.addListener((g, l, i) => {
  console.log(g);
  const a = L(g.xpath);
  return i(JSON.stringify(a)), !0;
});
